package si.assign2.ejb;

import java.util.List;

public interface ProductOperations {
	/*
	 * constraints:
	 * duplicate names of product, product type, category, 
	 * product type attribute within same product type 
	 * are not allowed 
	 */
	
	/*
	 * product, category and product type
	 */

	/**
	 * 
	 * @param productName name of the product to create
	 * @param sku sku for the product
	 * @param description description of the product
	 * @param purchasePrice price at which the product was purchased
	 * @param salePrice price at which the product is to be sold
	 * @param productTypeName name of the type the product belongs to
	 * 
	 * @return whether creation is successful 
	 *         possible causes of failure include a product with specific name
	 *         has already been created 
	 */
	public boolean createProduct(String productName, String sku, 
			String description, double purchasePrice, double salePrice,
			String productTypeName);
	
	/**
	 * 
	 * @param categoryName name of the category to create
	 * @param parentCategoryName name of the parent category of the category 
	 * @return if properly setup
	 */
	public boolean setupCategory(String categoryName, String productTypeName,  
			String parentCategoryName);
	
	/**
	 * 
	 * @param productName name of the product to be tied up with the category
	 * @param categoryName name of the category the product is tied up with
	 * 
	 * @return whether setting is successful
	 *         possible causes of failure include product with specific name
	 *         doesn't exist
	 */
	public boolean setProductCategory(String productName, String categoryName);

	
	/*
	 * product type attribute and its values
	 */
	
	/**
	 * @param productNaem name of the product value for which is to be set
	 * @param attributeName name of the attribute the value of which is to be set  
	 * @param attributeValue value the attribute value is set to
	 * 
	 * @returns whether setting is successful
	 */
	public boolean setProductAttributeValue(String productName, 
			String attributeName, String attributeValue);
	
	/**
	 * 
	 * @param productName name of the product value for which is to be set
	 * @param attributeName name of the attribute the value of which is to be gotten
	 * @return attributeValue value the attribute value is containing
	 */
	public String getProductAttributeValue(String productName, 
			String attributeName);
	
	/**
	 * 
	 * @param productTypeName name of the product type a list of products 
	 * of which to be obtained 
	 * @return the list of products to be obtained
	 */
	public List<String> getProductsOfProductType(String productTypeName);
	
	/**
	 * 
	 * @param category the category whose child categories are to be gotten
	 * @return list of child categories of the category specified
	 */
	public List<String> getChildCategories(String category);
	
	public String test();
}
